import matplotlib.pyplot as plt
import networkx as nx
import numpy as np

def read_knn_graph(graph_dir):
    with open(graph_dir, 'r') as file:
        lines = file.readlines()

    graph = []
    first_line = lines[0].split(' ')
    vertices = int(first_line[0])
    edges = int(first_line[1])
    for idx, line in enumerate(lines, start=0):
        if idx == 0:
            continue
        line_list = line.split(' ')
        # print(len(line_list))
        line_list = [int(x) for x in line_list if x != '\n']
        graph.append(line_list)
    return graph, vertices, edges

def read_graph(path):


def draw_graph():
    G = nx.Graph()

    pass


if __name__ == '__main__':
    ds_path = '/home/zhengbian/neural-product-quantization/data/dataset/normalsmall/base.fvecs'
    graph_path = '/home/zhengbian/neural-product-quantization/data/train_para/normalsmall_10_16_nn_1_knn_/Classifier_0/dataset_partition/graph.graph'

